package insight.google.game.era.bo.policy;

import insight.google.game.era.bo.GameUser;
import insight.google.game.era.data.Player;
import insight.google.game.era.data.policys.Policy;

import java.io.Serializable;
import java.util.Map;

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

import org.directwebremoting.annotations.DataTransferObject;
import org.directwebremoting.annotations.RemoteProperty;

import com.google.appengine.api.datastore.Key;

@DataTransferObject
public abstract class AbstractPolicy  implements Policy  {
	
	
	@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
	@PrimaryKey
	protected Key id;
	
	@RemoteProperty
	protected String generatedId;
	
	@RemoteProperty
	protected String name;
	
	@RemoteProperty
	protected boolean isFixed;

	protected String desc;
	
	
	
	public String getGeneratedId() {
		return generatedId;
	}
	public void setGeneratedId(String generatedId) {
		this.generatedId = generatedId;
	}
	public Key getId() {
		return id;
	}
	public void setId(Key id) {
		this.id = id;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getDesc() {
		return desc;
	}
	public void setDesc(String desc) {
		this.desc = desc;
	}
	@Override
	public boolean execute(Player from, Player[] targets, Map params) {
		// TODO Auto-generated method stub
		return false;
	}
	@Override
	public int getRange() {
		// TODO Auto-generated method stub
		return 0;
	}
	@Override
	
	public int getTargetNumber() {
		// TODO Auto-generated method stub
		return 0;
	}
	@Override
	public boolean isActive() {
		// TODO Auto-generated method stub
		return false;
	}
	@Override
	public void setActive(boolean active) {
		// TODO Auto-generated method stub
		
	}
	
	public boolean getIsFixed() {
		return isFixed;
	}

	public void setIsFixed(boolean isFixed) {
		this.isFixed = isFixed;
	}

	public abstract boolean execute(GameUser original, GameUser[] targets, Map params);
	
}
